#include <iostream>
#include <vector>
#include <set>
#include<cstring>
#include<map>
using namespace std;

int countDistinctWord(string str) {
	
	char s[100];
	strcpy(s,str.c_str());
	const char *d=" ";
	char *p;
	p=strtok(s,d);
	int i=0;
	while(p)
	{
		cout<<p<<endl;
		p=strtok(NULL,d);
		i++;
	}
	return i;
}

int main() {
	string str = "hello hello wwor world! Ni";
	cout << countDistinctWord(str) << endl;
	int c;
	cin>>c;
	return 0;
}